package cn.com.blueInfo.bpm.person.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.person.entity.Organization;
import cn.com.blueInfo.bpm.person.request.OrganizationDTO;
import cn.com.blueInfo.bpm.person.response.OrganizationVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 组织结构信息表 对象转换
 * @author suxch
 * @since 2025-08-31 16:18:02
 */
@Mapper(componentModel = "spring")
public interface OrganizationConvert
        extends BaseConvert<Organization, OrganizationDTO, OrganizationVO> {

    Organization dtoToEntity(OrganizationDTO dto);

    Organization dtoToEntity(OrganizationDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "treeType", target = "treeType", qualifiedByName = "enumToDesc")
    OrganizationVO entityToVO(Organization entity);

}